package db8;

import java.util.Scanner;

public class FruitTest {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        System.out.println("请输入你要创建的对象：");
        String fruitName=input.next();
        Fruit fruit  =null;
        switch (fruitName){
            case "苹果":
                fruit = new Apple();
                break;
            case "香蕉":
                fruit = new Pear();
                break;
            case "葡萄":
                fruit = new Oranges();
                break;
            default:
                break;
        }
        Gardener gardener =new Gardener();
        gardener.create(fruit);
    }
}
